﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="AcctrueWMS.Web.Login" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>爱创pms系统</title>
    <link href="res/styles/css/login.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="res/scripts/JQuery/jquery-1.5.1.js"></script>
    <script language="javascript" type="text/jscript" src="res/scripts/common.js"></script>
    <script language="javascript" type="text/javascript">
        $(document).ready(
            function () {
                $('#txtLoginName').keydown(
                function (event) {
                    if (event.keyCode == '13') {
                        //                       debugger;
                        $('#txtPassword')[0].focus();
                        return false;
                    }
                });

                $('#txtPassword').keydown(function (event) {
                    if (event.keyCode == '13') {
                        //                        debugger;
                        if (conf == 'true') {
                            $('#txtValidate')[0].focus();
                            return false;
                        }
                        else {
                        $('#imgLogin')[0].focus();
                        }
                    }

                });

                $('#txtValidate').keydown(function (event) {
                    if (event.keyCode == '13') {
                        //                        debugger;
                        $('#imgLogin')[0].focus();
                    }

                });

                var conf = wmsCommon.getConfig('loginValidate');
                if (conf == 'false') {
                    $('#liValidate').css('display', 'none');
                }

                $('#imgLogin').click(
                 function () {
                     //                                         debugger;
                     if ($.trim($("#txtLoginName").val()) == "") {
                         alert("用户名为空！");
                         $("#txtLoginName").focus();
                         return false;
                     }
                     else if ($("#txtPassword").val() == "") {
                         alert(" 密码为空！");
                         $("#txtPassword").focus();
                         return false;
                     }
                     else if (conf == 'true' && $("#txtValidate").val() == "") {
                         alert("验证码为空!");
                         $("#txtValidate").focus();
                         return false;
                     }
                     else {
                         return true;
                     }
                 });
            }
            );


        function reset() {
            $('#txtLoginName').value = "";
            $('#txtPassword').value = "";
            return false;
        }

        function refreshImage(obj) {
            obj.src = "validateCode.aspx?a=" + Math.random();
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <table cellspacing="0" cellpadding="0" style="height: 100%; width: 100%;">
        <tr>
            <td>
            </td>
            <td>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td style="height: 100%; width: 100%; text-align: center; vertical-align: top;">
                <div class="layout">
                    <div class="login">
                        <ul>
                            <li>用户名：<asp:TextBox ID="txtLoginName" class="logininput" runat="server" Text=""></asp:TextBox></li>
                            <li>密&nbsp;&nbsp;&nbsp;&nbsp;码：<asp:TextBox ID="txtPassword" class="logininput" runat="server" TextMode="Password" value=""></asp:TextBox></li>
                            <%if (AcctrueWMS.Foundation.Web.Runtime.ConfigManager.GetConfig("showValideCode") == "true")
                              {%>
                            <li id="liValidate">验证码：<asp:TextBox ID="txtValidate" class="longValidateIn" runat="server"></asp:TextBox><asp:ImageButton ID="imgValidate" runat="server" ImageUrl="~/exec/validateCode.aspx" OnClientClick="refreshImage(this);" /></li>
                            <%} %>
                        </ul>
                        <div class="clear">
                        </div>
                        <div class="loginbutton">
                            <asp:ImageButton ID="imgLogin" runat="server" ImageUrl="res/images/loginbutton1.gif"
                                OnClick="imgLogin_Click" />
                            <asp:ImageButton ID="imgReset" runat="server" ImageUrl="res/images/loginbutton2.gif"
                                OnClientClick="reset();" />
                        </div>
                    </div>
                    <div class="clear">
                    </div>
                    <div class="copyright">
                        <p>
                            北京爱创科技股份有限公司 All Rights Reserved<br />
                            Copyright 2009 www.acctrue.com 京ICP备05065875号</p>
                    </div>
                </div>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
            </td>
            <td>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
